﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class kill : cube
{
    public int getScore = 100;
    gamemanager gm;
    player player;
    // Start is called before the first frame update
    private void OnDestroy()
    {
        if (player.alive==true) { gm.score += getScore; }
    }
    protected override void Start()
    {
        gm =GameObject.FindGameObjectWithTag("gm").GetComponent<gamemanager>();
        
        player = GameObject.FindGameObjectWithTag("Player").GetComponent<player>();
    }
    
}
